﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace MyResKit
{
	public class LoadImage : MonoBehaviour
	{
		private ResLoader mLoader = new ResLoader();

		IEnumerator Start()
		{
			GetComponent<RawImage>().texture = mLoader.Load<Texture2D>("resources://Square");

			yield return new WaitForSeconds(3.0f);

			GetComponent<RawImage>().texture = mLoader.Load<Texture2D>("resources://SquareA");

			yield return new WaitForSeconds(3.0f);

			GetComponent<RawImage>().texture = mLoader.Load<Texture2D>("resources://SquareB");

			yield return new WaitForSeconds(3.0f);

			mLoader.UnloadAll();
		}

		void OnDestroy()
		{
			mLoader = null;
		}
	}

	public class OtherPage : MonoBehaviour
	{

	}
}
